package mobi.hami.huapin.dao;

import java.util.List;

import mobi.hami.huapin.daobase.CrudMapper;
import mobi.hami.huapin.dto.ProductForUserDTO;
import mobi.hami.huapin.model.SkuPictureMapping;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface SkuPictureMappingMapper  extends CrudMapper<SkuPictureMapping> {
    @Select("<script>"
            + "SELECT * FROM sku_picture_mapping  where  deleted=0 and spuid=#{spuid}"
            + "</script>")
    List<SkuPictureMapping>  selectImg(int spuid);
@Update("update sku_picture_mapping set deleted=1 where id=#{id} ")
    int falseDelete(int id);


    /**
     * 用户前端查询spu图片
     * @param ids
     * @return
     */
    @Select("SELECT spuid,mastertag,pictuire from sku_picture_mapping where spuid in (${ids}) and deleted=0 order by displayorder asc ")
    public List<SkuPictureMapping> getListForUser(@Param("ids")String ids);

}